﻿namespace LightCAD.Core.Elements
{
    public class LcArc : LcElement
    {
        public Vector2d Center;
        public double Radius;
        public double StartAngle;
        public double EndAngle;
        public Vector2d Startp;
        public Vector2d Endp;
        public Vector2d Midp;
        public LcArc()
        {
            this.Type = BuiltinElementType.Arc;
        }
        public LcArc(Vector2d center, double radius, double startAngle, double endAngle) : this()
        {
            this.Center = center;
            Radius = radius;
            this.StartAngle = startAngle;
            this.EndAngle = endAngle;
        }
        public LcArc(double centerX, double centerY, double radius, double startAngle, double endAngle)
        {
            this.Center.X = centerX;
            this.Center.Y = centerY;
            Radius = radius;
            this.StartAngle = startAngle;
            this.EndAngle = endAngle;
        }

        public override LcElement Clone()
        {
            var clone = new LcArc();
            clone.Copy(this);
            return clone;
        }

        public override void Copy(LcElement src)
        {
            var arc = ((LcArc)src);
            this.Center = arc.Center;
            this.Radius = arc.Radius;
            this.StartAngle = arc.StartAngle;
            this.EndAngle = arc.EndAngle;
        }

        public void Set(Vector2d? center, double? radius, double? startAngle, double? endAngle, bool fireChangeEvent = false)
        {

        }
    }
}
